import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {

  public navIndex: number; // 顶部导航栏点击index
  public pageUrl: Array<string>; // 界面url数组，用于刷新界面匹配nav
  public audioList: Array<object>;
  constructor(public router: Router) {
    this.navIndex = 0;
    this.pageUrl = ['/home/index', '/home/softDownload', '/home/softPic', '/home/softUpdate', '/home/otherProduct', '/home/editor'];
  }

  ngOnInit(): void {
    this.navIndex = this.pageUrl.indexOf(this.router.url);

    this.audioList = [{
      name: '世界这么大还是遇见你',
      type: 'mp3',
      singer: '程响',
      time: '237',
      size: '4800000',
      src: 'http://mp32.9ku.com/upload/128/2020/02/13/1002010.mp3',
      lrc: '../../../assets/music/世界这么大还是遇见你.json'
    },
    {
      name: '你的答案',
      type: 'wav',
      singer: '阿冗',
      time: '219',
      size: '3560000',
      src: 'http://mp32.9ku.com/upload/128/2019/11/08/998378.mp3',
      lrc: '../../../assets/music/你的答案.json'
    }];
  }

}
